package gspushmq.v1.consumer;

import gspushmq.model.Data;
import gspushmq.v1.consumer.core.MessageQueue;
import gspushmq.v1.consumer.core.PushCore;
import gspushmq.v1.produce.job.core.GGServiceJob;

import java.util.Map;

/**
 * @Description 在线用户消费
 * @Author 成尚佳
 * @Date 2019/1/17 14:37
 * @Version 1.0
 * @company 上海朝阳永续信息技术有限公司
 * @copyright (c) 2015 SunTime Co'Ltd Inc. All rights reserved.
 **/
public class OnlineConsumerJob extends GGServiceJob {


    @Override
    public String getJobName() {
        return "----在线消费线程"+Thread.currentThread().getName()+"启动成功----";
    }

    @Override
    public void doServiceJob(Map<String, Object> args) {

        while (true) {
            Data data = MessageQueue.messageQueue.take();
            PushCore.sendOnlineUsers(data);
        }

    }
}
